package com.example.homeworkmutualevaluation.Service;

import com.example.homeworkmutualevaluation.Dao.SubmitDao;
import com.example.homeworkmutualevaluation.Entity.Submit;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SubmitService {
    @Resource
    private SubmitDao submitDao;
    public void submitHomework(String sphone, int homeworkid, String content) {
        Submit submit = new Submit(sphone, homeworkid, content);
        submitDao.save(submit);
    }
    public Submit findBySphoneAndHomeworkid(String sphone, int homeworkid) {
        return submitDao.findBySphoneAndHomeworkid(sphone, homeworkid);
    }
    public List<Submit> findAllBySphone(String sphone) {
        return submitDao.findAllBySphone(sphone);
    }
    public List<String> findAllSubmitter(Integer homeworkid) {
        return submitDao.findAllSubmitter(homeworkid);
    }
    public void countScores(Integer homeworkid) {
        submitDao.countScores(homeworkid);
    }
    public String getContentByTaskid(int taskid) {
        return submitDao.getContentByTaskid(taskid);
    }
}
